package com.lh0811.forge.pserv.uacs.server.config.provider;

import com.lh0811.forge.dependency.security.core.model.entity.SecurityAuthority;
import com.lh0811.forge.pserv.uacs.server.component.data_scope.provider.AbstractSysRuleValueProvider;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class UserTenantSysRuleValueProvider extends AbstractSysRuleValueProvider<Long> {
    @Override
    public Long getRuleValueByCurrentUser(SecurityAuthority securityAuthority) throws Exception {
        return securityAuthority.getSecurityUser().getCurrTenantInfo().getId();
    }
}
